<template>
  <div class="app-container">
    <!--表单-->
     <el-form :inline="true" class="demo-form-inline">
      <el-form-item>
        <el-date-picker
          v-model="day"
          type="date"
          placeholder="选择开始日期"
          value-format="yyyy-MM-dd" />
      </el-form-item>
      <el-button
        :disabled="btnDisabled"
        type="primary"
        icon="el-icon-search"
        @click="showChart()">查询</el-button>
    </el-form>
    <div class="chart-container">
      <div id="chart" class="chart" style="height:500px;width:100%" />
    </div>
  </div>
</template>
<script>
import staApi from "@/api/sta";

export default {
  data() {
    return {
      searchObj: {},
      btnDisabled: false,
      xData: [],
      yData: [],
      day:""
    };
  },
  methods: {
    showChart(){
      staApi.createStaData(this.day)
        .then(response=>{
          //提示信息
          this.$message({
              type: 'success',
              message: '添加成功!'
          });
          this.$router.push({path:"/sta/show"})
        })
    }
  }
};
</script>
